﻿using System;
using UnityEngine;

namespace UnityStandardAssets.CinematicEffects
{
	// Token: 0x0200045F RID: 1119
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Anti-aliasing")]
	[ImageEffectAllowedInSceneView]
	public class AntiAliasing : MonoBehaviour
	{
		// Token: 0x170001DB RID: 475
		// (get) Token: 0x060017D9 RID: 6105 RVA: 0x00065694 File Offset: 0x00063A94
		// (set) Token: 0x060017DA RID: 6106 RVA: 0x0006569C File Offset: 0x00063A9C
		public int method
		{
			get
			{
				return this.m_Method;
			}
			set
			{
				if (this.m_Method == value)
				{
					return;
				}
				this.m_Method = value;
			}
		}

		// Token: 0x170001DC RID: 476
		// (get) Token: 0x060017DB RID: 6107 RVA: 0x000656B2 File Offset: 0x00063AB2
		public IAntiAliasing current
		{
			get
			{
				if (this.method == 0)
				{
					return this.m_SMAA;
				}
				return this.m_FXAA;
			}
		}

		// Token: 0x170001DD RID: 477
		// (get) Token: 0x060017DC RID: 6108 RVA: 0x000656CC File Offset: 0x00063ACC
		public Camera cameraComponent
		{
			get
			{
				if (this.m_Camera == null)
				{
					this.m_Camera = base.GetComponent<Camera>();
				}
				return this.m_Camera;
			}
		}

		// Token: 0x060017DD RID: 6109 RVA: 0x000656F1 File Offset: 0x00063AF1
		private void OnEnable()
		{
			this.m_SMAA.OnEnable(this);
			this.m_FXAA.OnEnable(this);
		}

		// Token: 0x060017DE RID: 6110 RVA: 0x0006570B File Offset: 0x00063B0B
		private void OnDisable()
		{
			this.m_SMAA.OnDisable();
			this.m_FXAA.OnDisable();
		}

		// Token: 0x060017DF RID: 6111 RVA: 0x00065723 File Offset: 0x00063B23
		private void OnPreCull()
		{
			this.current.OnPreCull(this.cameraComponent);
		}

		// Token: 0x060017E0 RID: 6112 RVA: 0x00065736 File Offset: 0x00063B36
		private void OnPostRender()
		{
			this.current.OnPostRender(this.cameraComponent);
		}

		// Token: 0x060017E1 RID: 6113 RVA: 0x00065749 File Offset: 0x00063B49
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			this.current.OnRenderImage(this.cameraComponent, source, destination);
		}

		// Token: 0x04000D1A RID: 3354
		[SerializeField]
		private SMAA m_SMAA = new SMAA();

		// Token: 0x04000D1B RID: 3355
		[SerializeField]
		private FXAA m_FXAA = new FXAA();

		// Token: 0x04000D1C RID: 3356
		[SerializeField]
		[HideInInspector]
		private int m_Method;

		// Token: 0x04000D1D RID: 3357
		private Camera m_Camera;

		// Token: 0x02000460 RID: 1120
		public enum Method
		{
			// Token: 0x04000D1F RID: 3359
			Smaa,
			// Token: 0x04000D20 RID: 3360
			Fxaa
		}
	}
}
